import { type ListData } from "@/types";
import { del, get, post, put } from ".";
import type { Good, GoodFilter, GoodModify } from "@/types/good";

export const getGoods = (param: GoodFilter) => {
  return get<ListData<Good>>("/good", param);
};

export const addGood = (param: GoodModify) => {
  return post<void>("/good", param);
};

export const updateGood = (param: GoodModify) => {
  return put<void>(`/good`, param);
};

export const delGood = (id: number) => {
  return del<void>(`/good/${id}`);
};
